const path = require('path');
const webpack = require('webpack');

module.exports = {
	publicPath: process.env.NODE_ENV === 'production' ? './' : './',
	filenameHashing: true,
	productionSourceMap: false,
	devServer: {
		proxy: {
			'/dev': {
				target: 'https://wq.huantu.cc/', // 后台接口域名
				secure: true, // 如果是https接口，需要配置这个参数
				changeOrigin: true, //是否跨域
				pathRewrite: {
					'^/dev': ''
				}
			}
		}
	},
	pluginOptions: {
		'style-resources-loader': {
			preProcessor: 'less',
			patterns: [path.resolve(__dirname, './src/var.less')] // 引入全局样式变量
		}
	}
};
